<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\BaseController;
use Illuminate\Http\Request;

/**
 * @package App\Http\Controllers\Api
 * @see ArticleController
 */
class ArticleController extends BaseController
{

    /**
     * getDetail
     * @uri /article/get-detail
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"id":"1202217367F82C4D"}
     * @response {"success":true,"statusCode":200,"result":{"id":"00KHZ8JNDGFMN3CUSTFSY6WW","cover_url":"676d6f4a2e7ccf9534fbf07ba1776a36.jpeg","title":"\u6587\u7ae0\u6807\u9898","description":"\u6587\u7ae0\u63cf\u8ff0","is_deleted":0,"is_shield":0,"created_at":1606419251,"original_url":"https:\/\/mp.weixin.qq.com\/s\/PybM-v4_-O2Obw_5u53uow","content":"\u6587\u7ae0\u5185\u5bb9","original":{"author_name":"","from":"\u5fae\u4fe1\u516c\u4f17\u53f7","time":"1606205585","url":"https:\/\/mp.weixin.qq.com\/s\/PybM-v4_-O2Obw_5u53uow"},"count":{"collect":1,"note":0},"note_list":[{"id":"24\u4f4d\u7b14\u8bb0ID","start_index":"1","end_index":"2"}],"is_collect":0},"message":"OK"}
     */
    public function getDetail(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":{"id":"00KHZ8JNDGFMN3CUSTFSY6WW","cover_url":"676d6f4a2e7ccf9534fbf07ba1776a36.jpeg","title":"\u6587\u7ae0\u6807\u9898","description":"\u6587\u7ae0\u63cf\u8ff0","is_deleted":0,"is_shield":0,"created_at":1606419251,"original_url":"https:\/\/mp.weixin.qq.com\/s\/PybM-v4_-O2Obw_5u53uow","content":"\u6587\u7ae0\u5185\u5bb9","original":{"author_name":"","from":"\u5fae\u4fe1\u516c\u4f17\u53f7","time":"1606205585","url":"https:\/\/mp.weixin.qq.com\/s\/PybM-v4_-O2Obw_5u53uow"},"count":{"collect":1,"note":0},"note_list":[{"id":"24\u4f4d\u7b14\u8bb0ID","start_index":"1","end_index":"2"}],"is_collect":0},"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

}